package ru.ifmo.ipimenov.ewf_svn.standalone.model;

import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
import ru.ifmo.ipimenov.ewf_svn.standalone.dao.CategoryDao;
import ru.ifmo.ipimenov.ewf_svn.standalone.dao.impl.CategoryDaoHibernate;
import ru.ifmo.ipimenov.ewf_svn.standalone.model.db.Category;

/**
 * @author: Ilya Pimenov
 * Scartel Starlab company
 */
public class CategoryProvider {
    /**
     * Logger for all purposes
     */
    private static Log log = LogFactory.getLog(CategoryProvider.class);

    private static CategoryProvider instance = new CategoryProvider();

    private CategoryDao dao = new CategoryDaoHibernate();

    public static CategoryProvider getInstance(){
        return instance;
    }

    public Category load(int index){
        return dao.load(index);
    }

    public void save(Category c){
        dao.save(c);
    }

}
